package com.mrd.evaluate.entity;

import org.hibernate.annotations.GenericGenerator;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;

/**
 * Created by lenovo on 2016/8/29.
 */
@Entity(name = "P_EVALUATION")
public class Evaluation implements Serializable {
    private static final long serialVersionUID = 277982641364664869L;
    /**
     * 编号
     */
    @Id
    @GeneratedValue(generator = "paymentableGenerator")
    @GenericGenerator(name = "paymentableGenerator", strategy = "uuid")
    @Column(name = "EVAL_ID_")
    private String evalId;
    /**
     * 评价对象关联编号(单证编号)
     */
    @Column(name = "RELATION_ID_")
    private String relationId;
    /**
     * 评价分值
     */
    @Column(name = "EVAL_SCORE_")
    private int evalScore;
    /**
     * 状态
     */
    @Column(name = "STATE_")
    private String state;

//    private Date businessTime;

    @OneToMany(mappedBy = "evaluation", cascade = CascadeType.ALL)
    private List<EvaluationRecord> evaluationRecords;

    public String getEvalId() {
        return evalId;
    }

    public void setEvalId(String evalId) {
        this.evalId = evalId;
    }

    public String getRelationId() {
        return relationId;
    }

    public void setRelationId(String relationId) {
        this.relationId = relationId;
    }

    public int getEvalScore() {
        return evalScore;
    }

    public void setEvalScore(int evalScore) {
        this.evalScore = evalScore;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public List<EvaluationRecord> getEvaluationRecords() {
        return evaluationRecords;
    }

    public void setEvaluationRecords(List<EvaluationRecord> evaluationRecords) {
        this.evaluationRecords = evaluationRecords;
    }

    @Override
    public String toString() {
        return "Evaluation{" +
                "evalId='" + evalId + '\'' +
                ", relationId='" + relationId + '\'' +
                ", evalScore=" + evalScore +
                ", state='" + state + '\'' +
                '}';
    }
}
